//package com.kly.user.task.service;
//
//import cn.hutool.core.date.DateTime;
//import cn.hutool.core.date.DateUnit;
//import cn.hutool.core.date.DateUtil;
//import com.alibaba.fastjson.JSONObject;
//import com.alibaba.nacos.api.config.annotation.NacosValue;
//import com.fqgj.common.api.Page;
//import com.fqgj.common.utils.CollectionUtils;
//import com.fqgj.common.utils.StringUtils;
//import com.fqgj.log.factory.LogFactory;
//import com.fqgj.log.interfaces.Log;
//import com.google.api.client.util.Lists;
//import com.google.common.collect.Maps;
//import com.google.common.eventbus.AsyncEventBus;
//import com.kly.enums.ParameterTypeEnum;
//import com.kly.user.db.dao.UserBehaviorLogDao;
//import com.kly.user.db.dao.UserDao;
//import com.kly.user.db.dao.UserWlmDao;
//import com.kly.user.db.dao.UserWlmLogDao;
//import com.kly.user.db.entity.*;
//import com.kly.user.enums.AppEnum;
//import com.kly.user.enums.LikeEnum;
//import com.kly.user.enums.OnlineStatus;
//import com.kly.user.enums.UserType;
//import com.kly.user.eventbus.ActionEnum;
//import com.kly.user.eventbus.Event;
//import com.kly.user.rulePolicy.Column;
//import com.kly.user.rulePolicy.DecisionAPI;
//import com.kly.user.rulePolicy.DecisionVO;
//import com.kly.user.rulePolicy.PolicySet;
//import com.kly.user.rulePolicy.enums.DecisionResultEnum;
//import com.kly.user.rulePolicy.enums.VariableTypeEnum;
//import com.kly.user.task.ExecuteHandler;
//import com.kly.user.task.ExecuteResult;
//import com.kly.user.task.enums.TaskStatusEnum;
//import com.kly.user.task.enums.TaskTypeEnum;
//import org.springframework.beans.BeanUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import javax.annotation.Resource;
//import java.util.*;
//import java.util.concurrent.atomic.AtomicInteger;
//
///**
// * 按照指定策略对likes mode用户自动likes back
// */
//@Service("likesBackImpl")
//public class LikesBackImpl implements ExecuteHandler {
//    private static Log logger = LogFactory.getLog("taskFileLog");
//
//    @Resource
//    UserWlmDao userWlmDao;
//
//    @Resource
//    UserWlmLogDao userWlmLogDao;
//    @Resource
//    DecisionAPI decisionAPI;
//    @Resource
//    AsyncEventBus pushEventBus;
//
//    @Autowired
//    private UserBehaviorLogDao userBehaviorLogDao;
//    @Resource
//    UserDao userDao;
//
//
//    @NacosValue(value = "${likeback.send.switch:false}", autoRefreshed = true)
//    private boolean likebackSendSwitch;
//
//    @NacosValue(value = "${likeback.policy.version:1}", autoRefreshed = true)
//    private Integer likeBackPolicyVersion;
//
//    @NacosValue(value = "${likeback.policy.whilteUser:122}", autoRefreshed = true)
//    private String likeBackPolicyWhiteList;
//
//
//    /**
//     * likes back策略
//     */
//    private static final String LIKES_BACK_POLICY = "2";
//
//    @Override
//    public TaskTypeEnum getType() {
//        return TaskTypeEnum.LIKES_BACK;
//    }
//
//    @Override
//    public <T> ExecuteResult doExecute(T t) throws Exception {
//        if (likeBackPolicyVersion == 2) {
//            return doExecute2(t);
//        } else if (likeBackPolicyVersion == 3) {
//            doExecute2(t);
//        }
//
//        // 当前记录数
//        AtomicInteger currentIndex = new AtomicInteger(1);
//
//        UserTaskJobEntity entity = (UserTaskJobEntity) t;
//        logger.info("====LikeBackJobStarting, job detail:{}", JSONObject.toJSONString(entity));
//        Page page = new Page(100);
//
//        final int totalRecordNum = userWlmDao.queryLikeMeForModelTotal();
//        if (totalRecordNum == 0) {
//            logger.info("====LikeBackJob: userLikesRecordNotExists, currentJobQuiteImmediately");
//            return ExecuteResult.builder().jobId(entity.getId()).resultMsg("success").resultCode(TaskStatusEnum.SUCCESS.getCode()).taskType(TaskTypeEnum.LIKES_BACK.getCode()).build();
//        }
//        page.setTotalCount(totalRecordNum);
//
//        for (int i = currentIndex.get(); i <= page.getTotalPageNum(); i++) {
//            System.out.println("当前页数：" + i);
//            final List<UserWlmEntity> userWlmEntities = queryLikesRecordForModel(page, currentIndex.get());
//            if (CollectionUtils.isEmpty(userWlmEntities)) {
//                continue;
//            }
//            for (UserWlmEntity user : userWlmEntities) {
//                DecisionVO decisionVO = DecisionVO.builder().userCode(user.getUserCode()).policyId(LIKES_BACK_POLICY).apiReqId(UUID.randomUUID().toString()).build();
//                // 规则变量提取
//                List<Column> columns = buildDecisionColumns(user);
//                decisionVO.setColumns(columns);
//
//                // 调用规则控制接口
//                final PolicySet policySet = decisionAPI.decisionResult(decisionVO);
//
//                // 决策通过
//                if (Objects.nonNull(policySet) && policySet.getPolicySetResult().equals(DecisionResultEnum.PASS.getType())) {
//
//                    // 查询model信息
//                    final UserEntity modelAccount = userDao.selectByUserCode(user.getUserCodeWlm());
//                    if (Objects.nonNull(modelAccount) && OnlineStatus.ONLINE_STATUS.getType() != modelAccount.getOnline() && UserType.CHATTER_MODEL.getType() != modelAccount.getUserType()) {
//                        logger.error("====LikeBackJobFailed, userCode:{}, modelCode:{}, modelNotExistsOrOffLine", user.getUserCode(), user.getUserCodeWlm());
//                        continue;
//                    }
//
//                    // 更新用户记录
//                    user.setWlmType(LikeEnum.LIKE_EACH_OTHER.getType());
//                    user.setContactTime(new Date());
//                    user.setLikesBackTime(new Date());
//                    userWlmDao.updateByPrimaryKey(user);
//
//                    // model like back
//                    try {
//                        UserWlmEntity modelLikesBackRecord = new UserWlmEntity();
//                        modelLikesBackRecord.setLikesBackTime(new Date());
//                        modelLikesBackRecord.setContactTime(new Date());
//                        modelLikesBackRecord.setUserCode(user.getUserCodeWlm());
//                        modelLikesBackRecord.setUserCodeWlm(user.getUserCode());
//                        modelLikesBackRecord.setWlmType(LikeEnum.LIKE_EACH_OTHER.getType());
//                        userWlmDao.insert(modelLikesBackRecord);
//
//
//                        userWlmLogDao.addWlmLog(modelLikesBackRecord);
//
//                        // matched消息推送
//                        logger.info("pushNewMatchMessage: userCode:{}, modeCode:{}", user.getUserCode(), user.getUserCodeWlm());
//                        pushNewMatchMessage(user.getUserCode(), user.getUserCodeWlm(), AppEnum.MECHAT);
//                        pushNewMatchMessage(user.getUserCodeWlm(), user.getUserCode(), AppEnum.MEBOO);
//
//
//                    } catch (Exception e) {
//                        if (e.getMessage().contains("Duplicate entry")) {
//                            logger.info("====LikeBackJobStoreFailed, userCode:{}, result:{}", user.getUserCode(), JSONObject.toJSONString(policySet));
//                        }
//                    }
//                }
//                logger.info("====LikeBackJobEnd, userCode:{}, result:{}", user.getUserCode(), JSONObject.toJSONString(policySet));
//            }
//            currentIndex.getAndIncrement();
//        }
//
//
//        final ExecuteResult result = ExecuteResult.builder().jobId(entity.getId()).resultMsg("success").resultCode(TaskStatusEnum.SUCCESS.getCode()).taskType(TaskTypeEnum.LIKES_BACK.getCode()).build();
//        logger.info("Like back job end, result:{}", JSONObject.toJSONString(result));
//        return result;
//    }
//
//    public <T> ExecuteResult doExecute2(T t) throws Exception {
//
//        UserTaskJobEntity entity = (UserTaskJobEntity) t;
//        //找出今天所有收到likeback数量小于3的用户
//        logger.info("== 开始处理likeback ==");
//        final List<UserEntity> userEntities = userDao.queryAppAccounts();
//        logger.info("== 开始处理likeback ==,真实用户数据量size:{}", userEntities.size());
//        List<UserEntity> allOnlineModels = userDao.getAllModelsNotAssignedChatter(1);
//        userEntities.forEach(user -> {
//            logger.info("== 开始处理likeback{} ==,name:{}", user.getUserCode(), user.getNickName());
//            try {
//                sendSingleLikeBack(user, allOnlineModels);
//            } catch (Exception e) {
//                logger.error("== 开始处理likeback{},name:{}", user.getUserCode(), user.getNickName(), e);
//            }
//
//        });
//
//
//        final ExecuteResult result = ExecuteResult.builder().jobId(entity.getId()).resultMsg("success").resultCode(TaskStatusEnum.SUCCESS.getCode()).taskType(TaskTypeEnum.LIKES_BACK.getCode()).build();
//        logger.info("Like back job end, result:{}", JSONObject.toJSONString(result));
//        return result;
//    }
//
//    public void sendSingleLikeBack(UserEntity user, List<UserEntity> allOnlineModels) {
//        if (StringUtils.isNotEmpty(likeBackPolicyWhiteList)) {
//            if (!likeBackPolicyWhiteList.equals("*")) {
//                if (!likeBackPolicyWhiteList.contains(user.getUserCode())) {
//                    logger.info("====开始处理likeback{} 当前指定用户才能下,name:{},不能使用当前策略", user.getUserCode(), user.getNickName());
//                    return;
//                } else {
//                    logger.info("====开始处理likeback{} 指定改用户才能被下发,name:{}", user.getUserCode(), user.getNickName());
//                }
//            }
//        }
//        //今天用户发起的喜欢的数据
//        List<UserWlmEntity> todayWlmRecords = userWlmDao.getWlmRecordsV2(user.getUserCode(), true);
//        int todayIlikeCount = 0;
//        for (UserWlmEntity u : todayWlmRecords) {
//            if (u.getWlmType() == 1 || u.getWlmType() == 3) {
//                todayIlikeCount++;
//            }
//        }
//
//        if (todayIlikeCount == 0) {
//            logger.info("== 开始处理likeback{} 当前用户还没有喜欢过任何人==", user.getUserCode());
//            return;
//        }
//
//        int todayLikeTimes = todayWlmRecords.size();
//        logger.info("== 开始处理likeback{} ==，name:{},todayLikeTimes:{}", user.getUserCode(), user.getNickName(), todayLikeTimes);
//
//        List<UserWlmEntity> todayOtherActionsToMe = userWlmDao.getRecordsByWmlCodeV2(user.getUserCode(),true);
//        int todayGetLikeBackTimes = 0;
//        long lastLikeBackTillNowMins = 10000L;
//        for (UserWlmEntity r : todayOtherActionsToMe) {
//            if (r.getWlmType() == 1 || r.getWlmType() == 3) {
//                if (r.getLikesBackTime() != null) {
//                    todayGetLikeBackTimes++;
//                }
//
//                if (r.getWlmType() == 3) {
//                    long between = DateUtil.between(DateUtil.date(), r.getGmtCreate(), DateUnit.MINUTE);
//                    if (between < lastLikeBackTillNowMins) {
//                        lastLikeBackTillNowMins = between;
//                    }
//                }
//
//            }
//        }
//
//        logger.info("== 开始处理likeback{} likeback 1==，todayGetLikeBackTimes:{}", user.getUserCode(), todayGetLikeBackTimes);
//        if (todayGetLikeBackTimes > 3) {
//            logger.info("== 开始处理likeback{} likeback太多了 2==，todayGetLikeBackTimes:{}", user.getUserCode(), todayGetLikeBackTimes);
//            return;
//        }
//
//        double v = todayIlikeCount * 0.4 - todayGetLikeBackTimes;
//        logger.info("== 开始处理likeback{} likeback 3==，todayIlikeCount:{},todayGetLikeBackTimes:{}", user.getUserCode(), todayIlikeCount, todayGetLikeBackTimes);
//        if (v < 0.0) {
//            logger.info("== 开始处理likeback{} likeback太多了 4==，todayIlikeCount:{},todayGetLikeBackTimes:{}", user.getUserCode(), todayIlikeCount, todayGetLikeBackTimes);
//            return;
//        }
//
//        if (user.getOnline() == 1) {
//            logger.info("== 开始处理likeback{} likeback上次下发时间 ==，todayIlikeCount:{},todayGetLikeBackTimes:{},lastLikeBackTillNowMins:{}", user.getUserCode(), todayIlikeCount, todayGetLikeBackTimes, lastLikeBackTillNowMins);
//            if (lastLikeBackTillNowMins <= (1 + todayGetLikeBackTimes)) {
//                logger.info("== 开始处理likeback{} likeback上次下发时间太近了==,todayIlikeCount:{},todayGetLikeBackTimes:{},lastLikeBackTillNowMins:{}", user.getUserCode(), todayIlikeCount, todayGetLikeBackTimes, lastLikeBackTillNowMins);
//                return;
//            }
//        }
//
//        if (user.getOnline() != 1) {
//
//            long fromLatestOperationToCurrent = 100000L;
//            UserBehaviorLogEntity todayFirstRecord = userBehaviorLogDao.getTodayFirstRecord(user.getUserCode(), 99);
//            if (Objects.nonNull(todayFirstRecord)) {
//                fromLatestOperationToCurrent = DateUtil.between(DateUtil.date(), todayFirstRecord.getGmtCreate(), DateUnit.MINUTE);
//            }
//            int hour = com.fqgj.common.utils.DateUtil.getHour();
//            int minute = com.fqgj.common.utils.DateUtil.getMinute();
//            boolean openAppToday = (hour * 60L + minute) > fromLatestOperationToCurrent;
//
//            logger.info("== 开始处理likeback{} 上次启动距离现在的时间==，fromLatestOperationToCurrent:{},openAppToday:{}", user.getUserCode(), fromLatestOperationToCurrent, openAppToday);
//            if (openAppToday) {
//                if (lastLikeBackTillNowMins <= (todayGetLikeBackTimes * 30L)) {
//                    logger.info("== 开始处理likeback{} 上次下发时间小于策略制定的上次下发时间2==，lastLikeBackTillNowMins:{},todayGetLikeBackTimes:{}", user.getUserCode(), lastLikeBackTillNowMins, todayGetLikeBackTimes);
//                    return;
//                }
//            } else {
//                if ((hour * 60 + minute) > (20 * 60 + 12)) {
//                    logger.info("== 开始处理likeback{} 大于20：12不下发==，hour:{},mins:{}", user.getUserCode(), hour, minute);
//                    return;
//                }
//
//                if (lastLikeBackTillNowMins <= (todayGetLikeBackTimes * 30L)) {
//                    logger.info("== 开始处理likeback{} 上次下发时间小于策略制定的上次下发时间2==,lastLikeBackTillNowMins:{},todayGetLikeBackTimes:{}", user.getUserCode(), lastLikeBackTillNowMins, todayGetLikeBackTimes);
//                    return;
//                }
//            }
//        }
//
//        logger.info("== 开始处理likeback{} likeback 可以下发==,name:{},todayGetLikeBackTimes:{}", user.getUserCode(), user.getNickName(), todayGetLikeBackTimes);
//
//        //找到当前用户like过的人，且状态为在线的chatter
//        List<UserEntity> customerLikedModelListByCustomerUserCode = userDao.getCustomerLikedModelListByCustomerUserCode(user.getUserCode());
//        logger.info("== 开始处理likeback{} likeback 可以下发== name:{},todayGetLikeBackTimes:{},customerLikedModelListByCustomerUserCode:{}", user.getUserCode(), user.getNickName(), todayGetLikeBackTimes, customerLikedModelListByCustomerUserCode.size());
//        List<UserEntity> onlineChatters = new ArrayList<>();
//        if (!CollectionUtils.isEmpty(customerLikedModelListByCustomerUserCode)) {
//            customerLikedModelListByCustomerUserCode.forEach(u -> {
//                if (u.getOnline() == 1) {
//                    onlineChatters.add(u);
//                }
//            });
//        }
//
//        UserEntity modelDoLikeBack = null;
//        if (CollectionUtils.isEmpty(onlineChatters)) {
//            logger.info("== 开始处理likeback{} 喜欢的人里面没有在线的chatter,我们找在线的model==", user.getUserCode());
//            modelDoLikeBack = allOnlineModels.get(new Random().nextInt(allOnlineModels.size()));
//        } else modelDoLikeBack = onlineChatters.get(new Random().nextInt(onlineChatters.size()));
//
//        if (modelDoLikeBack == null) {
//            logger.info("== 开始处理likeback{} 喜欢的人里面没有在线的chatter,也没有在线的model可以选择==", user.getUserCode());
//            return;
//        }
//
//        if (!likebackSendSwitch) {
//            logger.info("====开始处理likeback{} 开关未打开 找到合适的在线下发对象,", modelDoLikeBack.getUserCode());
//            return;
//        }
//        try {
//            // 更新用户记录的喜欢记录
//            UserWlmEntity relation = userWlmDao.getRelation(user.getUserCode(), modelDoLikeBack.getUserCode());
//            relation.setWlmType(LikeEnum.LIKE_EACH_OTHER.getType());
//            relation.setContactTime(new Date());
//            relation.setLikesBackTime(new Date());
//            userWlmDao.updateByPrimaryKey(relation);
//
//            //新增likeback记录
//            UserWlmEntity modelLikesBackRecord = new UserWlmEntity();
//            modelLikesBackRecord.setLikesBackTime(new Date());
//            modelLikesBackRecord.setContactTime(new Date());
//            modelLikesBackRecord.setUserCode(modelDoLikeBack.getUserCode());
//            modelLikesBackRecord.setUserCodeWlm(user.getUserCode());
//            modelLikesBackRecord.setWlmType(LikeEnum.LIKE_EACH_OTHER.getType());
//            userWlmDao.insert(modelLikesBackRecord);
//
//            userWlmLogDao.addWlmLog(modelLikesBackRecord);
//
//            // matched消息推送
//            logger.info("== 开始处理likeback{} pushNewMatchMessage:  modeCode:{}", user.getUserCode(), modelDoLikeBack.getUserCode());
//            try {
//                pushNewMatchMessage(user.getUserCode(), modelDoLikeBack.getUserCode(), AppEnum.MECHAT);
//                logger.info("== 开始处理likeback 推送给mechat 成功:  modeCode:{}", user.getUserCode(), modelDoLikeBack.getUserCode());
//            } catch (Exception e) {
//                logger.info("== 开始处理likeback{} 推送给mechat发生错误:  modeCode:{}", user.getUserCode(), modelDoLikeBack.getUserCode(), e);
//                return;
//            }
//            try {
//                pushNewMatchMessage(modelDoLikeBack.getUserCode(), user.getUserCode(), AppEnum.MEBOO);
//                logger.info("== 开始处理likeback{}, 推送给meboo 成功:  modeCode:{}", user.getUserCode(), modelDoLikeBack.getUserCode());
//            } catch (Exception e) {
//                logger.info("== 开始处理likeback{} 推送给meboo 失败:  modeCode:{}", user.getUserCode(), modelDoLikeBack.getUserCode(), e);
//            }
//
//
//        } catch (Exception e) {
//            if (e.getMessage().contains("Duplicate entry")) {
//                logger.info("====== 开始处理likeback,Duplicate entry, userCode:{}", user.getUserCode(), e);
//            }
//        }
//
//
//    }
//
//    private void pushNewMatchMessage(String fromUserCode, String toUserCode, AppEnum appEnum) {
//        pushEventBus.post(buildEvent(fromUserCode, toUserCode, appEnum));
//    }
//
//    private Event buildEvent(String fromUserCode, String toUserCode, AppEnum appEnum) {
//        Map<String, Integer> params = Maps.newHashMap();
//        params.put("type", ParameterTypeEnum.MATCHED_PUSH.getId());
//        return Event.builder().eventActionEnum(ActionEnum.PUSH_MSG).fromUserCode(fromUserCode).toUserCode(toUserCode).app(appEnum).content(JSONObject.toJSONString(params)).build();
//    }
//
//    private List<UserWlmEntity> queryLikesRecordForModel(Page page, int currentIndex) {
//        page.setCurrentPage(currentIndex);
//        return userWlmDao.queryLikeMeForModel(page);
//    }
//
//    private List<Column> buildDecisionColumns(UserWlmEntity user) {
//        final ArrayList<Column> columns = Lists.newArrayList();
//
//        // 用户发起LIKES时间大于5s且未收到likes back
//        final UserWlmEntity latestLikeBack = userWlmDao.receivedMaxLikeBackTime(user.getUserCode());
//        long fromLikesToCurrentTime = 0;
//        if (Objects.nonNull(latestLikeBack)) {
//            fromLikesToCurrentTime = DateUtil.between(DateUtil.date(), latestLikeBack.getLikesBackTime(), DateUnit.SECOND);
//        } else {
//            // 保证规则能通过的任意数
//            fromLikesToCurrentTime = 99999999;
//        }
//        final Column likesTimeToCurrent = Column.builder().columnCode("var_from_user_likes_to_current").columnType(VariableTypeEnum.INT.name()).columnValue(fromLikesToCurrentTime).build();
//        columns.add(likesTimeToCurrent);
//
//        // 用户3min内收到新的LIKES BACK
//        final DateTime befor3Min = DateUtil.offsetMinute(DateUtil.date(), -3);
//        final Column likesNumBefor3Min = Column.builder().columnCode("var_likes_back_num_in_latest_3_min").columnType(VariableTypeEnum.INT.name()).columnValue(userWlmDao.receivedLikeBackNum(user.getUserCode(), LikeEnum.LIKE_EACH_OTHER, null, befor3Min)).build();
//        columns.add(likesNumBefor3Min);
//
//        // 当日LIKES BACK数量
//        final DateTime today = DateUtil.beginOfDay(DateUtil.date());
//        final int likeBackNumToday = userWlmDao.receivedLikeBackNum(user.getUserCode(), LikeEnum.LIKE_EACH_OTHER, null, today);
//        final Column likesBackNumToday = Column.builder().columnCode("var_has_likes_back_num_today").columnType(VariableTypeEnum.INT.name()).columnValue(likeBackNumToday).build();
//        columns.add(likesBackNumToday);
//
//        // 当日建联数
//        final Column contactNumToday = Column.builder().columnCode("var_like_each_num_today").columnType(VariableTypeEnum.INT.name()).columnValue(userWlmDao.queryContactNumToday(user.getUserCode(), null, LikeEnum.LIKE_EACH_OTHER)).build();
//        columns.add(contactNumToday);
//
//        // 今日LIKES*40%-今日LIKES BACK数
//        int likesNumToday = userWlmDao.userLike(user.getUserCode(), LikeEnum.LIKE.getType(), today) + userWlmDao.userLike(user.getUserCode(), LikeEnum.LIKE_EACH_OTHER.getType(), today);
//        double likesBackRate = likesNumToday * 0.4 - likeBackNumToday;
//        final Column likeBackRateNumToday = Column.builder().columnCode("var_likes_back_rate_today").columnType(VariableTypeEnum.INT.name()).columnValue(Double.valueOf(likesBackRate).intValue()).build();
//        columns.add(likeBackRateNumToday);
//
//        // 在线且距离上一次LIKES BACK时间大于3min
//        int likesBackNumIn3Min = userWlmDao.receivedLikeBackNum(user.getUserCode(), null, OnlineStatus.ONLINE_STATUS, befor3Min);
//        final Column likesBackNumIn3MinVar = Column.builder().columnCode("var_online_and_distance_from_latest_likes_back_to_current").columnType(VariableTypeEnum.INT.name()).columnValue(likesBackNumIn3Min).build();
//        columns.add(likesBackNumIn3MinVar);
//
//        // 离线且 (10am-2pm范围内的的随机时间点)以后距离上一次LIKES BACK时间大于2h
//        // 10am-2pm之间的任意一个时间点
//        final DateTime itIs10AmToday = DateUtil.offsetHour(DateUtil.beginOfDay(DateUtil.date()), 10);
//        final DateTime aRandomTimeBetween10amAnd2pm = DateUtil.offsetMinute(itIs10AmToday, new Random().nextInt(240));
//        int hasSendNumAfterRandomTime = userWlmDao.receivedLikeBackNum(user.getUserCode(), null, OnlineStatus.OFFLINE_STATUS, DateUtil.offsetMinute(aRandomTimeBetween10amAnd2pm, 120));
//        final Column sentWlmInRandom6pmAnd8Pm = Column.builder().columnCode("var_offline_and_distance_from_latest_likes_back_to_current").columnType(VariableTypeEnum.INT.name()).columnValue(hasSendNumAfterRandomTime).build();
//        columns.add(sentWlmInRandom6pmAnd8Pm);
//
//        return columns;
//    }
//
//    public static void main(String[] args) {
//        final DateTime today = DateUtil.beginOfDay(DateUtil.date());
//        System.out.println(today);
//
//    }
//}
